package vip.liux.front.infrastructure.tenant;

import com.alibaba.ttl.TransmittableThreadLocal;

public class TenantContext {

    public static final String TENANT_ID = "__tenant";

    private static final ThreadLocal<String> tenantId = new TransmittableThreadLocal<>();

    public static void setCurrentTenant(String id) {
        tenantId.set(id);
    }

    public static String getCurrentTenant() {
        return tenantId.get();
    }

    public static void clear() {
        tenantId.remove();
    }
}